﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace Bussiness_Objects
{
    /// <summary>
    /// Thong tin table PHIEUTHUTIENPHAT
    /// --PHIEUTHUTIENPHAT(SoPTT,MaDocGia,NgayThu,TongNo,SoTienThu,ConLai)
    /// </summary>
    public class PhieuThuTienPhat : BusinessObjects
    {
        public PhieuThuTienPhat()
        {

        }

        public PhieuThuTienPhat(int _soPtt, int _maDG, string _ngThu, long _tgNo, long _tienThu, long _conLai)
        {
            SoPTT = _soPtt;
            MaDocGia = _maDG;
            NgayThu = _ngThu;
            TongNo = _tgNo;
            SoTienThu = _tienThu;
            ConLai = _conLai;
        }

        /// <summary>
        /// Dat parameter cho store "sp_PHIEUTHUTIENPHAT_selectByMaDocGia" tham so (MaDocGia)
        /// </summary>
        public void SetParameterSelectKey()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parMaDocGia, MaDocGia);
            parms[0] = _parm;
        }

        public void SetParameterSelectID()
        {
            parms = new object[1];
            SqlParameter _parm = new SqlParameter(parSoPTT, SoPTT);
            parms[0] = _parm;
        }

        public void SetParameterDelete()
        {
            SetParameterSelectID();
        }

        public override void SetParameterInsert()
        {
            parms = new object[3];
            SqlParameter _parm = new SqlParameter(parMaDocGia, MaDocGia);
            parms[0] = _parm;

            _parm = new SqlParameter(parSoTienThu, SoTienThu);
            parms[1] = _parm;

            _parm = new SqlParameter(parNgatThu, NgayThu);
            parms[2] = _parm;
        }

        public override void SetParameterUpdate()
        {
            parms = new object[4];
            SqlParameter _parm = new SqlParameter(parMaDocGia, MaDocGia);
            parms[0] = _parm;

            _parm = new SqlParameter(parSoTienThu, SoTienThu);
            parms[1] = _parm;

            _parm = new SqlParameter(parNgatThu, NgayThu);
            parms[2] = _parm;

            _parm = new SqlParameter(parSoPTT, SoPTT);
            parms[3] = _parm;
        }

        public int SoPTT { get; set; }
        private const string parSoPTT = "@SoPTT";

        public int MaDocGia { get; set; }
        private const string parMaDocGia = "@MaDocGia";

        public string NgayThu { get; set; }
        private const string parNgatThu = "@NgayThu";

        public long TongNo { get; set; }
        private const string parTongNo = "@TongNo";

        public long SoTienThu { get; set; }
        private const string parSoTienThu = "@SoTienThu";

        public long ConLai { get; set; }
        private const string parConLai = "@ConLai";
    }
}
